<?php

Route::group(['middleware' => 'web', 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{
    Auth::routes();
});

Route::group(['middleware' => ['web','auth:admin'], 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{
    Route::get('/', 'AdminController@index'); //后台首页路由
    Route::resource('role','RoleController')->middleware("permission:admin,resource"); //角色管理资源路由
    Route::get('role/permission/{role}','RoleController@permission')->middleware("permission:admin"); //展示权限列表模板路由
    Route::post('role/permission/{role}','RoleController@permissionStore')->middleware("permission:admin"); //添加权限路由
    Route::resource('adminuser','AdminUserController')->middleware("permission:admin,resource");//后台用户路由
    Route::get('/adminuser/showRole/{adminuserid}','AdminUserController@showRole')->middleware("permission:admin,resource"); //用户分配角色加载模板路由
    Route::post('/adminuser/assignRole/{adminuserid}','AdminUserController@assignRole')->middleware("permission:admin"); //用户分配角色路由
});
